package CH5.Demo2;

import CH5.Demo1.Father;

/**
 * @author: LiuBoTao
 * @date: 2022/9/22
 * @ApiNote
 */
public class Son  extends Father {
    public Son(){
        this(1);
        //System.out.println("Son construct");
    }
    public Son(int  i){
        super((short)i);
        //System.out.println("Son construct");
    }
    String hand="hand of Son";
    String foot="foot of Son";
    /**/String head=" head of Son";

  /**/  void print2(){
        System.out.println("head="+super.head);
    }
    void print3(){
        //System.out.println("weight="+weight);
        printWeiht();

    }
    public   int print(int i){///print_int
        //super.print();
        //System.out.println("Son's weight=");
        //System.out.println("Son's height=");
        //System.out.println("Son's  head=");
        System.out.println("Son's  hand="+hand);
        System.out.println("Son's  hand="+super.hand);
        return 1;
    }
    public static void main(String[] args) {
        Son s=new Son();
        //s.
        Father s2=s;
        /* s2.;*/

        Father s3=new Son();
        Son s4=(Son)s3;
       // s.super.print();
     /*  s.print();*/
       s.print(1);
        //s.print2();
       // s.print3();
        /* s.speak("aaa");*/
 /*       s.print();
        System.out.println("hand="+s.hand);
        System.out.println("hand="+s.foot);*/

    }
}

class Son1  extends Father{

}

class Test
{   Son s;
    public static void main(String[] args)
    {
        Son  s=new Son();
        //if(s instanceof Son)
        if(s instanceof Father)
        // /*if(s instanceof Son1)*/
        {
            System.out.println("YES");
        }
    }
}

